package com.yang.booking.controller;

import com.yang.booking.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/provider/user/insertUser")
    public Map<String, Object> insertUser(@RequestParam(name = "storeId") String storeId,
                                          @RequestParam(name = "name") String name
    ){
        return userService.insertUser(storeId, name);
    }

    @PostMapping("/provider/user/sing")
    public Map<String, Object> sing_in(@RequestParam(name = "username") String username,
                                       @RequestParam(name = "password") String password
    ){
        return userService.sign_in(username, password);
    }
}
